import equal from "./equal"

/**
 * 过滤表单树没有变更的值
 * @param { object } form 表单树
 * @param vo 比对的 vo
 */
const formChange = (form , vo = { }) => {
  return Object.keys(form).reduce((result , key) => {
    const formValue = form[key] , voValue = vo[key]
    if (!equal(formValue , voValue)) {
      result[key] = formValue
    }
    return result
  } , { })
}
export default formChange;